﻿namespace HRM.CORE.REPORT
{
    using APP.HELPER.Utils.CustomizeToolbox;
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptSalaryPayBank : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private IContainer components;
        private DetailBand Detail;
        private GroupFooterBand GroupFooter1;
        private GroupHeaderBand GroupHeader1;
        private HRM_SALARY_PAY l_Salary;
        private HRM_SALARY_TABLELIST l_SalaryTableList;
        private string m_Code;
        private int m_Index;
        private int m_Level;
        private int m_Month;
        private int m_Order;
        private bool m_ShowOrder;
        private int m_Year;
        private PageFooterBand PageFooter;
        private ReportFooterBand ReportFooter;
        private ReportHeaderBand ReportHeader;
        private TopMarginBand TopMargin;
        private XRTableCell txtBankCode;
        private XRTableCell txtBankName;
        private XRTableCell txtEmployeeCode;
        private XRTableCell txtFirstName;
        private XRTableCell txtMoney;
        private XRTableCell txtOrder;
        private XRLabel txtTitle;
        private XRTableCell txtTotalHonestSalaryMoney;
        private XRTableCell txtTotalMoney;
        private XRLabel txtTotalMoneyText;
        private XRLabel txtTotalTotalRealMoney;
        private XRLabel txtUnit;
        private XRLabel xrLabel1;
        private XRLabel xrLabel16;
        private XRLabel xrLabel3;
        private XRPageInfo xrPageInfo1;
        private XRTable xrTable1;
        private XRTable xrTable2;
        private XRTable xrTable4;
        private XRTableCell xrTableCell1;
        private XRTableCell xrTableCell13;
        private XRTableCell xrTableCell18;
        private XRTableCell xrTableCell25;
        private XRTableCell xrTableCell3;
        private XRTableCell xrTableCell4;
        private XRTableRow xrTableRow1;
        private XRTableRow xrTableRow2;
        private XRTableRow xrTableRow5;

        public rptSalaryPayBank()
        {
            this.l_Salary = new HRM_SALARY_PAY();
            this.l_SalaryTableList = new HRM_SALARY_TABLELIST();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_Order = 1;
            this.m_ShowOrder = false;
            this.m_Index = 0;
            this.components = null;
            this.InitializeComponent();
        }

        public rptSalaryPayBank(int Level, string Code, int Month, int Year)
        {
            this.l_Salary = new HRM_SALARY_PAY();
            this.l_SalaryTableList = new HRM_SALARY_TABLELIST();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_Order = 1;
            this.m_ShowOrder = false;
            this.m_Index = 0;
            this.components = null;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.m_Month = Month;
            this.m_Year = Year;
        }

        public rptSalaryPayBank(int Level, string Code, int Month, int Year, int Order, bool ShowOrder)
        {
            this.l_Salary = new HRM_SALARY_PAY();
            this.l_SalaryTableList = new HRM_SALARY_TABLELIST();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_Order = 1;
            this.m_ShowOrder = false;
            this.m_Index = 0;
            this.components = null;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.m_Month = Month;
            this.m_Year = Year;
            this.m_Order = Order;
            this.m_ShowOrder = ShowOrder;
        }

        public string ChangeUnicode(string title)
        {
            string str = title.Trim().ToLower().Replace(" - ", "-").Replace("- ", "-").Replace(" -", "-").Replace("`", "").Replace("~", "").Replace("!", "").Replace("@", "").Replace("#", "").Replace("$", "").Replace("%", "").Replace("^", "").Replace("&", "").Replace("*", "").Replace("|", "").Replace("=", "").Replace("+", "").Replace(",", "").Replace("'", "").Replace(";", "").Replace(":", "").Replace("[", "").Replace("]", "").Replace("{", "").Replace("}", "").Replace(" ...", "").Replace(" ..", "").Replace(" .", "").Replace("...", "").Replace("..", "").Replace("(", "").Replace(")", "").Replace("“", "").Replace("”", "").Replace("\"", "").Replace("'", "").Replace("đ", "d").Replace("?", "").Replace("/", ".").Replace("_", "-").Replace("__", "-").Replace("ả", "a").Replace("\x00e0", "a").Replace("\x00e1", "a").Replace("\x00e3", "a").Replace("ạ", "a").Replace("ă", "a").Replace("ắ", "a").Replace("ằ", "a").Replace("ẳ", "a").Replace("ẵ", "a").Replace("ặ", "a").Replace("\x00e2", "a").Replace("ấ", "a").Replace("ầ", "a").Replace("ẩ", "a").Replace("ẫ", "a").Replace("ậ", "a").Replace("\x00e9", "e").Replace("\x00e8", "e").Replace("ẻ", "e").Replace("ẽ", "e").Replace("ẹ", "e").Replace("\x00ea", "e").Replace("ế", "e").Replace("ề", "e").Replace("ể", "e").Replace("ễ", "e").Replace("ệ", "e").Replace("\x00ed", "i").Replace("\x00ec", "i").Replace("ỉ", "i").Replace("ĩ", "i").Replace("ị", "i").Replace("\x00f3", "o").Replace("\x00f2", "o").Replace("ỏ", "o").Replace("\x00f5", "o").Replace("ọ", "o").Replace("\x00f4", "o").Replace("ố", "o").Replace("ồ", "o").Replace("ổ", "o").Replace("ỗ", "o").Replace("ộ", "o").Replace("ơ", "o").Replace("ớ", "o").Replace("ờ", "o").Replace("ở", "o").Replace("ỡ", "o").Replace("ợ", "o").Replace("\x00fa", "u").Replace("\x00f9", "u").Replace("ủ", "u").Replace("ũ", "u").Replace("ụ", "u").Replace("ư", "u").Replace("ứ", "u").Replace("ừ", "u").Replace("ử", "u").Replace("ữ", "u").Replace("ự", "u").Replace("\x00fd", "y").Replace("ỳ", "y").Replace("ỷ", "y").Replace("ỹ", "y").Replace("ỵ", "y");
            if (str.Substring(str.Length - 1) == ".")
            {
                str = str.Substring(0, str.Length - 1);
            }
            return str;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private string FormatName(string m_Name)
        {
            string str = "";
            string[] strArray = m_Name.Replace("  ", " ").Split(new char[] { ' ' });
            string str2 = "";
            for (int i = 0; i < strArray.Length; i++)
            {
                str2 = strArray[i];
                if (str2.Length >= 2)
                {
                    str2 = str2.Substring(0, 1).ToUpper() + str2.Substring(1);
                    if (i == 0)
                    {
                        str = str + str2;
                    }
                    else
                    {
                        str = str + " " + str2;
                    }
                }
            }
            return str;
        }

        private void InitializeComponent()
        {
            this.Detail = new DetailBand();
            this.xrTable2 = new XRTable();
            this.xrTableRow2 = new XRTableRow();
            this.txtOrder = new XRTableCell();
            this.txtEmployeeCode = new XRTableCell();
            this.txtFirstName = new XRTableCell();
            this.txtBankCode = new XRTableCell();
            this.txtMoney = new XRTableCell();
            this.txtBankName = new XRTableCell();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.ReportHeader = new ReportHeaderBand();
            this.txtTitle = new XRLabel();
            this.txtUnit = new XRLabel();
            this.xrTable1 = new XRTable();
            this.xrTableRow1 = new XRTableRow();
            this.xrTableCell1 = new XRTableCell();
            this.xrTableCell13 = new XRTableCell();
            this.xrTableCell3 = new XRTableCell();
            this.xrTableCell4 = new XRTableCell();
            this.xrTableCell18 = new XRTableCell();
            this.ReportFooter = new ReportFooterBand();
            this.xrLabel16 = new XRLabel();
            this.txtTotalMoneyText = new XRLabel();
            this.txtTotalTotalRealMoney = new XRLabel();
            this.xrLabel3 = new XRLabel();
            this.xrLabel1 = new XRLabel();
            this.GroupFooter1 = new GroupFooterBand();
            this.xrTable4 = new XRTable();
            this.xrTableRow5 = new XRTableRow();
            this.xrTableCell25 = new XRTableCell();
            this.txtTotalMoney = new XRTableCell();
            this.txtTotalHonestSalaryMoney = new XRTableCell();
            this.PageFooter = new PageFooterBand();
            this.xrPageInfo1 = new XRPageInfo();
            this.GroupHeader1 = new GroupHeaderBand();
            this.xrTable2.BeginInit();
            this.xrTable1.BeginInit();
            this.xrTable4.BeginInit();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { this.xrTable2 });
            this.Detail.HeightF = 29.16667f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.xrTable2.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.xrTable2.Font = new Font("Times New Roman", 8.25f);
            this.xrTable2.LocationFloat = new PointFloat(0f, 0f);
            this.xrTable2.Name = "xrTable2";
            this.xrTable2.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.xrTable2.Rows.AddRange(new XRTableRow[] { this.xrTableRow2 });
            this.xrTable2.SizeF = new SizeF(710.9999f, 29.16667f);
            this.xrTable2.StylePriority.UseBorders = false;
            this.xrTable2.StylePriority.UseFont = false;
            this.xrTable2.StylePriority.UsePadding = false;
            this.xrTable2.StylePriority.UseTextAlignment = false;
            this.xrTable2.TextAlignment = TextAlignment.MiddleLeft;
            this.xrTableRow2.Cells.AddRange(new XRTableCell[] { this.txtOrder, this.txtEmployeeCode, this.txtFirstName, this.txtBankCode, this.txtMoney, this.txtBankName });
            this.xrTableRow2.Name = "xrTableRow2";
            this.xrTableRow2.Weight = 1.0;
            this.txtOrder.Font = new Font("Times New Roman", 9f);
            this.txtOrder.Name = "txtOrder";
            this.txtOrder.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtOrder.StylePriority.UseFont = false;
            this.txtOrder.StylePriority.UsePadding = false;
            this.txtOrder.StylePriority.UseTextAlignment = false;
            this.txtOrder.Text = "txtOrder";
            this.txtOrder.TextAlignment = TextAlignment.MiddleCenter;
            this.txtOrder.Weight = 0.14345303566043449;
            this.txtOrder.BeforePrint += new PrintEventHandler(this.txtOrder_BeforePrint);
            this.txtEmployeeCode.Borders = BorderSide.Bottom | BorderSide.Left;
            this.txtEmployeeCode.Font = new Font("Times New Roman", 9f);
            this.txtEmployeeCode.Name = "txtEmployeeCode";
            this.txtEmployeeCode.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtEmployeeCode.StylePriority.UseBorders = false;
            this.txtEmployeeCode.StylePriority.UseFont = false;
            this.txtEmployeeCode.StylePriority.UsePadding = false;
            this.txtEmployeeCode.StylePriority.UseTextAlignment = false;
            this.txtEmployeeCode.Text = "txtEmployeeCode";
            this.txtEmployeeCode.TextAlignment = TextAlignment.MiddleLeft;
            this.txtEmployeeCode.Weight = 0.0082873466756828162;
            this.txtFirstName.Borders = BorderSide.Bottom | BorderSide.Right;
            this.txtFirstName.Font = new Font("Times New Roman", 9f);
            this.txtFirstName.Name = "txtFirstName";
            this.txtFirstName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtFirstName.StylePriority.UseBorders = false;
            this.txtFirstName.StylePriority.UseFont = false;
            this.txtFirstName.StylePriority.UsePadding = false;
            this.txtFirstName.StylePriority.UseTextAlignment = false;
            this.txtFirstName.Text = "[FirstName] [LastName]";
            this.txtFirstName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtFirstName.Weight = 0.7418901221716937;
            this.txtFirstName.BeforePrint += new PrintEventHandler(this.txtFirstName_BeforePrint);
            this.txtBankCode.Font = new Font("Microsoft Sans Serif", 8.25f);
            this.txtBankCode.Name = "txtBankCode";
            this.txtBankCode.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtBankCode.StylePriority.UseFont = false;
            this.txtBankCode.StylePriority.UsePadding = false;
            this.txtBankCode.StylePriority.UseTextAlignment = false;
            this.txtBankCode.Text = "[BankCode]";
            this.txtBankCode.TextAlignment = TextAlignment.MiddleCenter;
            this.txtBankCode.Weight = 0.60577217935690575;
            this.txtMoney.Font = new Font("Microsoft Sans Serif", 8.25f);
            this.txtMoney.Name = "txtMoney";
            this.txtMoney.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtMoney.StylePriority.UseFont = false;
            this.txtMoney.StylePriority.UsePadding = false;
            this.txtMoney.StylePriority.UseTextAlignment = false;
            this.txtMoney.Text = "txtMoney";
            this.txtMoney.TextAlignment = TextAlignment.MiddleRight;
            this.txtMoney.Weight = 0.37293070396076772;
            this.txtBankName.Font = new Font("Microsoft Sans Serif", 8.25f);
            this.txtBankName.Name = "txtBankName";
            this.txtBankName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtBankName.StylePriority.UseFont = false;
            this.txtBankName.StylePriority.UsePadding = false;
            this.txtBankName.StylePriority.UseTextAlignment = false;
            this.txtBankName.Text = "[BankName]";
            this.txtBankName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtBankName.Weight = 1.0738178495602559;
            this.TopMargin.HeightF = 70f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 45f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.ReportHeader.Controls.AddRange(new XRControl[] { this.txtTitle, this.txtUnit });
            this.ReportHeader.HeightF = 50.24998f;
            this.ReportHeader.Name = "ReportHeader";
            this.txtTitle.Font = new Font("Times New Roman", 18f, FontStyle.Bold);
            this.txtTitle.LocationFloat = new PointFloat(0f, 0f);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTitle.SizeF = new SizeF(710.9999f, 30.25001f);
            this.txtTitle.StylePriority.UseFont = false;
            this.txtTitle.StylePriority.UseTextAlignment = false;
            this.txtTitle.Text = "DANH S\x00c1CH TRẢ LƯƠNG";
            this.txtTitle.TextAlignment = TextAlignment.MiddleCenter;
            this.txtUnit.Font = new Font("Times New Roman", 11f, FontStyle.Bold);
            this.txtUnit.LocationFloat = new PointFloat(0f, 30.24998f);
            this.txtUnit.Name = "txtUnit";
            this.txtUnit.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtUnit.SizeF = new SizeF(711f, 20f);
            this.txtUnit.StylePriority.UseFont = false;
            this.txtUnit.StylePriority.UseTextAlignment = false;
            this.txtUnit.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTable1.AnchorVertical = VerticalAnchorStyles.Bottom;
            this.xrTable1.BackColor = Color.WhiteSmoke;
            this.xrTable1.BorderColor = Color.Black;
            this.xrTable1.Borders = BorderSide.All;
            this.xrTable1.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.xrTable1.LocationFloat = new PointFloat(0f, 0f);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new XRTableRow[] { this.xrTableRow1 });
            this.xrTable1.SizeF = new SizeF(710.9999f, 37.33333f);
            this.xrTable1.StylePriority.UseBackColor = false;
            this.xrTable1.StylePriority.UseBorderColor = false;
            this.xrTable1.StylePriority.UseBorders = false;
            this.xrTable1.StylePriority.UseFont = false;
            this.xrTable1.StylePriority.UseTextAlignment = false;
            this.xrTable1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableRow1.Cells.AddRange(new XRTableCell[] { this.xrTableCell1, this.xrTableCell13, this.xrTableCell3, this.xrTableCell4, this.xrTableCell18 });
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.Weight = 1.0;
            this.xrTableCell1.CanGrow = false;
            this.xrTableCell1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrTableCell1.Name = "xrTableCell1";
            this.xrTableCell1.StylePriority.UseFont = false;
            this.xrTableCell1.StylePriority.UseTextAlignment = false;
            this.xrTableCell1.Text = "STT";
            this.xrTableCell1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell1.Weight = 0.14345282266846374;
            this.xrTableCell13.CanGrow = false;
            this.xrTableCell13.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrTableCell13.Name = "xrTableCell13";
            this.xrTableCell13.StylePriority.UseFont = false;
            this.xrTableCell13.StylePriority.UseTextAlignment = false;
            this.xrTableCell13.Text = "Họ v\x00e0 t\x00ean";
            this.xrTableCell13.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell13.Weight = 0.75017725196554541;
            this.xrTableCell3.CanGrow = false;
            this.xrTableCell3.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrTableCell3.Name = "xrTableCell3";
            this.xrTableCell3.StylePriority.UseFont = false;
            this.xrTableCell3.StylePriority.UseTextAlignment = false;
            this.xrTableCell3.Text = "T\x00e0i khoản";
            this.xrTableCell3.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell3.Weight = 0.60577179849524321;
            this.xrTableCell4.CanGrow = false;
            this.xrTableCell4.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrTableCell4.Name = "xrTableCell4";
            this.xrTableCell4.StylePriority.UseFont = false;
            this.xrTableCell4.StylePriority.UseTextAlignment = false;
            this.xrTableCell4.Text = "Số tiền";
            this.xrTableCell4.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell4.Weight = 0.37293050107343;
            this.xrTableCell18.CanGrow = false;
            this.xrTableCell18.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrTableCell18.Name = "xrTableCell18";
            this.xrTableCell18.StylePriority.UseFont = false;
            this.xrTableCell18.StylePriority.UseTextAlignment = false;
            this.xrTableCell18.Text = "Ng\x00e2n h\x00e0ng";
            this.xrTableCell18.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell18.Weight = 1.0738180279481266;
            this.ReportFooter.Controls.AddRange(new XRControl[] { this.xrLabel16, this.txtTotalMoneyText, this.txtTotalTotalRealMoney, this.xrLabel3, this.xrLabel1 });
            this.ReportFooter.HeightF = 88.00003f;
            this.ReportFooter.Name = "ReportFooter";
            this.xrLabel16.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrLabel16.LocationFloat = new PointFloat(492.0885f, 54.20834f);
            this.xrLabel16.Name = "xrLabel16";
            this.xrLabel16.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel16.SizeF = new SizeF(218.9114f, 17.79169f);
            this.xrLabel16.StylePriority.UseFont = false;
            this.xrLabel16.Text = "Ng\x00e0y .… th\x00e1ng ...... năm 20.....";
            this.txtTotalMoneyText.Font = new Font("Times New Roman", 11f, FontStyle.Italic | FontStyle.Bold, GraphicsUnit.Point, 0);
            this.txtTotalMoneyText.LocationFloat = new PointFloat(74.09763f, 25.99997f);
            this.txtTotalMoneyText.Name = "txtTotalMoneyText";
            this.txtTotalMoneyText.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTotalMoneyText.SizeF = new SizeF(636.9023f, 20.00001f);
            this.txtTotalMoneyText.StylePriority.UseFont = false;
            this.txtTotalMoneyText.Text = "Kh\x00f4ng đồng.";
            this.txtTotalTotalRealMoney.Font = new Font("Times New Roman", 11f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.txtTotalTotalRealMoney.LocationFloat = new PointFloat(74.09762f, 0f);
            this.txtTotalTotalRealMoney.Name = "txtTotalTotalRealMoney";
            this.txtTotalTotalRealMoney.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTotalTotalRealMoney.SizeF = new SizeF(636.9023f, 21f);
            this.txtTotalTotalRealMoney.StylePriority.UseFont = false;
            this.txtTotalTotalRealMoney.Text = "0 VNĐ";
            this.txtTotalTotalRealMoney.Visible = false;
            this.xrLabel3.Font = new Font("Times New Roman", 11f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrLabel3.LocationFloat = new PointFloat(6.357829E-05f, 26f);
            this.xrLabel3.Name = "xrLabel3";
            this.xrLabel3.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel3.SizeF = new SizeF(74.09756f, 20f);
            this.xrLabel3.StylePriority.UseFont = false;
            this.xrLabel3.Text = "Bằng chữ:";
            this.xrLabel1.Font = new Font("Times New Roman", 11f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.xrLabel1.LocationFloat = new PointFloat(4.768372E-05f, 0f);
            this.xrLabel1.Name = "xrLabel1";
            this.xrLabel1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel1.SizeF = new SizeF(74.09759f, 21f);
            this.xrLabel1.StylePriority.UseFont = false;
            this.xrLabel1.Text = "Tổng tiền:";
            this.xrLabel1.Visible = false;
            this.GroupFooter1.Controls.AddRange(new XRControl[] { this.xrTable4 });
            this.GroupFooter1.HeightF = 29.16667f;
            this.GroupFooter1.Name = "GroupFooter1";
            this.xrTable4.BackColor = Color.WhiteSmoke;
            this.xrTable4.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.xrTable4.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.xrTable4.LocationFloat = new PointFloat(0f, 0f);
            this.xrTable4.Name = "xrTable4";
            this.xrTable4.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.xrTable4.Rows.AddRange(new XRTableRow[] { this.xrTableRow5 });
            this.xrTable4.SizeF = new SizeF(710.9999f, 29.16667f);
            this.xrTable4.StylePriority.UseBackColor = false;
            this.xrTable4.StylePriority.UseBorders = false;
            this.xrTable4.StylePriority.UseFont = false;
            this.xrTable4.StylePriority.UsePadding = false;
            this.xrTable4.StylePriority.UseTextAlignment = false;
            this.xrTable4.TextAlignment = TextAlignment.MiddleLeft;
            this.xrTableRow5.Cells.AddRange(new XRTableCell[] { this.xrTableCell25, this.txtTotalMoney, this.txtTotalHonestSalaryMoney });
            this.xrTableRow5.Name = "xrTableRow5";
            this.xrTableRow5.Weight = 1.0;
            this.xrTableCell25.Font = new Font("Times New Roman", 11f, FontStyle.Bold);
            this.xrTableCell25.Name = "xrTableCell25";
            this.xrTableCell25.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.xrTableCell25.StylePriority.UseFont = false;
            this.xrTableCell25.StylePriority.UsePadding = false;
            this.xrTableCell25.StylePriority.UseTextAlignment = false;
            this.xrTableCell25.Text = "Tổng cộng";
            this.xrTableCell25.TextAlignment = TextAlignment.MiddleLeft;
            this.xrTableCell25.Weight = 1.4994029101796553;
            this.txtTotalMoney.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold);
            this.txtTotalMoney.Name = "txtTotalMoney";
            this.txtTotalMoney.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtTotalMoney.StylePriority.UseFont = false;
            this.txtTotalMoney.StylePriority.UsePadding = false;
            this.txtTotalMoney.StylePriority.UseTextAlignment = false;
            this.txtTotalMoney.Text = "txtTotalMoney";
            this.txtTotalMoney.TextAlignment = TextAlignment.MiddleRight;
            this.txtTotalMoney.Weight = 0.3729305724869772;
            this.txtTotalMoney.SummaryCalculated += new TextFormatEventHandler(this.txtTotalRealMoney_SummaryCalculated);
            this.txtTotalHonestSalaryMoney.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold);
            this.txtTotalHonestSalaryMoney.Name = "txtTotalHonestSalaryMoney";
            this.txtTotalHonestSalaryMoney.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtTotalHonestSalaryMoney.StylePriority.UseFont = false;
            this.txtTotalHonestSalaryMoney.StylePriority.UsePadding = false;
            this.txtTotalHonestSalaryMoney.StylePriority.UseTextAlignment = false;
            this.txtTotalHonestSalaryMoney.TextAlignment = TextAlignment.MiddleRight;
            this.txtTotalHonestSalaryMoney.Weight = 1.0738177547191077;
            this.PageFooter.Controls.AddRange(new XRControl[] { this.xrPageInfo1 });
            this.PageFooter.HeightF = 23.00002f;
            this.PageFooter.Name = "PageFooter";
            this.xrPageInfo1.LocationFloat = new PointFloat(3f, 0f);
            this.xrPageInfo1.Name = "xrPageInfo1";
            this.xrPageInfo1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrPageInfo1.SizeF = new SizeF(701.0001f, 23.00002f);
            this.xrPageInfo1.StylePriority.UseTextAlignment = false;
            this.xrPageInfo1.TextAlignment = TextAlignment.MiddleCenter;
            this.GroupHeader1.Controls.AddRange(new XRControl[] { this.xrTable1 });
            this.GroupHeader1.HeightF = 37.33333f;
            this.GroupHeader1.Name = "GroupHeader1";
            this.GroupHeader1.RepeatEveryPage = true;
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.ReportHeader, this.ReportFooter, this.GroupFooter1, this.PageFooter, this.GroupHeader1 });
            base.Font = new Font("Times New Roman", 9.75f);
            base.Margins = new Margins(0x49, 0x2b, 70, 0x2d);
            base.PageHeight = 0x491;
            base.PageWidth = 0x33b;
            base.PaperKind = PaperKind.A4;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListEmployee_BeforePrint);
            this.xrTable2.EndInit();
            this.xrTable1.EndInit();
            this.xrTable4.EndInit();
            this.EndInit();
        }

        private void LoadAllData()
        {
            this.l_SalaryTableList.Get(this.m_Month, this.m_Year);
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table = this.l_Salary.GetListByOrder(this.m_Level, this.m_Code, this.l_SalaryTableList.SalaryTableListID, this.m_Order);
            if (this.m_Level != 0)
            {
                if (this.m_Level == 1)
                {
                    HRM_BRANCH hrm_branch = new HRM_BRANCH();
                    hrm_branch.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_branch.BranchName;
                }
                else if (this.m_Level == 2)
                {
                    HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                    hrm_department.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_department.DepartmentName;
                }
                else if (this.m_Level == 3)
                {
                    HRM_GROUP hrm_group = new HRM_GROUP();
                    hrm_group.Get(this.m_Code);
                    this.txtUnit.Text = "Đơn vị: " + hrm_group.GroupName;
                }
            }
            set.Tables.Add(table);
            base.DataSource = set;
            base.DataAdapter = table;
            base.DataMember = table.TableName;
            this.txtEmployeeCode.DataBindings.Add("Text", base.DataSource, "EmployeeCode");
            this.txtMoney.DataBindings.Add("Text", base.DataSource, "Money", "{0:##,##0}");
            this.txtTotalMoney.DataBindings.Add("Text", base.DataSource, "Money", "{0:##,##0}");
            this.txtTotalMoney.Summary = new XRSummary(SummaryRunning.Group, SummaryFunc.Sum, "{0:##,##0}");
        }

        private void rptListEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            if (!this.m_ShowOrder)
            {
                this.txtTitle.Text = "DANH S\x00c1CH TRẢ LƯƠNG TH\x00c1NG " + this.m_Month.ToString() + " NĂM " + this.m_Year.ToString();
            }
            else
            {
                this.txtTitle.Text = "DANH S\x00c1CH TRẢ LƯƠNG LẦN " + this.m_Order.ToString() + " - TH\x00c1NG " + this.m_Month.ToString() + " NĂM " + this.m_Year.ToString();
            }
            this.LoadAllData();
            CreateHeaderReport.CreateHeader(this.ReportHeader);
            CreateFooterReport.CreateFooter("IsSalary", this.ReportFooter, this);
        }

        private void txtFirstName_BeforePrint(object sender, PrintEventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.txtEmployeeCode.Text);
            this.txtFirstName.Text = this.FormatName(this.ChangeUnicode(hrm_employee.FirstName + " " + hrm_employee.LastName));
        }

        private void txtOrder_BeforePrint(object sender, PrintEventArgs e)
        {
            this.m_Index++;
            this.txtOrder.Text = this.m_Index.ToString();
        }

        private void txtTotalRealMoney_SummaryCalculated(object sender, TextFormatEventArgs e)
        {
            try
            {
                this.txtTotalTotalRealMoney.Text = decimal.Parse(e.Text).ToString("##,##0") + " VNĐ";
                this.txtTotalMoneyText.Text = GridCalendarControlLib.ToText(decimal.Parse(e.Text));
            }
            catch
            {
            }
        }
    }
}

